package com.chouxiaozi.dynamicproxy.cxzproxy;

import com.chouxiaozi.IPerson;
import com.chouxiaozi.dynamicproxy.jdkproxy.JDKMeipo;
import com.chouxiaozi.dynamicproxy.jdkproxy.Son;
import sun.misc.ProxyGenerator;

import java.io.FileOutputStream;

public class TestCxzProxy {
    public static void main(String[] args) {
        IPerson person = (IPerson)new CxzMeipo().getInstance(new Son());
        System.out.println(person);
        person.findLove();

        //$Proxy0
        /*try{
            byte [] bytes = ProxyGenerator.generateProxyClass("$Proxy0",new Class[]{IPerson.class});
            FileOutputStream os = new FileOutputStream("E://$Proxy0.class");
            os.write(bytes);
            os.close();
        }catch (Exception e){
            e.printStackTrace();
        }*/
    }
}
